<template>
    <div>
      <table border="1">
        <tr>
          <th>用户名</th>
          <th>开始时间</th>
          <th>结束时间</th>
          <th>费用</th>
          <th>教练</th>
        </tr>
        <tr v-for="i in us_record" :key="i.id">
          <th>{{i.member.name}}</th>
          <th>{{i.start_time}}</th>
          <th>{{i.end_time}}</th>
          <th>{{i.total}}</th>
          <th>{{i.coach.name}}</th>
        </tr>
      </table>
    </div>
</template>

<script>
    export default {
        name: "CoachRecord",
      data(){
          return{
            us_record:[],
            uid:sessionStorage.getItem("id"),
            coach_id:this.$route.query.id

          }
      },
      methods:{

      },
      created() {

          this.axios.patch("cart/?coach_id="+this.coach_id)
        .then(resp=>{
        //   console.log(resp.data)
          console.log(resp.data)
          this.us_record = resp.data
        }).catch(err=>{
          console.log(err)
          })

      }
    }
</script>

<style scoped>

</style>
